package com.hmall.item.utils;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //默认的拦截路径就是/**  ,excludePathPatterns()是不用拦截的路径
        registry.addInterceptor(new UserInterceptor()).addPathPatterns("/**").excludePathPatterns();
        registry.addInterceptor(new UserInterceptor());
    }

}
